package com.ruoyi.order.mapper;

import java.util.List;
import com.ruoyi.order.domain.OrderBy;
import com.ruoyi.order.domain.Details;
import com.ruoyi.system.api.domain.Product;
import org.apache.ibatis.annotations.Param;

import javax.websocket.server.PathParam;

/**
 * 订单Mapper接口
 * 
 * @author ruoyi
 * @date 2023-10-12
 */
public interface OrderByMapper 
{
    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    public OrderBy selectOrderByByOrderId(Long orderId);

    /**
     * 查询订单列表
     * 
     * @param orderBy 订单
     * @return 订单集合
     */
    public List<OrderBy> selectOrderByList(OrderBy orderBy);

    /**
     * 新增订单
     * 
     * @param orderBy 订单
     * @return 结果
     */
    public int insertOrderBy(OrderBy orderBy);

    /**
     * 修改订单
     * 
     * @param orderBy 订单
     * @return 结果
     */
    public int updateOrderBy(OrderBy orderBy);

    /**
     * 删除订单
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteOrderByByOrderId(Long orderId);

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOrderByByOrderIds(Long[] orderIds);

    /**
     * 批量删除订单详情
     * 
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDetailsByOrderDetailsIds(Long[] orderIds);
    
    /**
     * 批量新增订单详情
     * 
     * @param detailsList 订单详情列表
     * @return 结果
     */
    public int batchDetails(List<Details> detailsList);
    

    /**
     * 通过订单主键删除订单详情信息
     * 
     * @param orderId 订单ID
     * @return 结果
     */
    public int deleteDetailsByOrderDetailsId(Long orderId);

    List<OrderBy> selectOrderByUserId(Long userId);

    List<OrderBy> getOrderDetail(@Param("productByShopsId") List<Product> productByShopsId);

    List<OrderBy> selectOrderByByStatus(Long status);
}
